const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); // 通过 npm 安装


module.exports = {
    mode: 'development',
    //单入口文件
    entry: './src/index.js',
    //多入口文件
    // entry: {
    //     main: './webpack/src/index.js',
    //     search: './webpack/src/search.js'
    // },
    //__dirname目录名  
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js',
        //多个出口
        // filename: '[name].js'
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: './3.html'
        })
    ]
};